This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
got a handle to IE window - now how do I write to it?
OK, I figured out how to get a "handle" to an already-opened IE window. But now how do I enter text in that window? I need to somehow combine the code I previously posted with this...
Declarations
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (Byval lpClassName As String, Byval lpWindowName As Long) As Long
Dim hwnd As Long
Const vbinformation = 64 ' Remove if running in native Visual Basic
Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (Byval hWnd As Long, Byval lpClassName As String, Byval nMaxCount As Long) As Long
Declare Function ShowWindow Lib "user32" (Byval hwnd As Long, Byval nCmdShow As Long) As Long
Click Event
Sub Click(Source As Button)
REM Call the FindWindow API; this API returns a window handle.
'hwnd = FindWindow( "Internet Explorer", 0& )
hwnd=FindWindow("IEFrame", 0&)
REM See if you were able to obtain the Window handle.
If hwnd <> 0 Then ' If not zero a window handle was obtained.
Msgbox "Successfully obtained Window Handle (HWND) for " & "IE.", vbInformation, "Got Handle"
ShowWindow hwnd, 3
fActivateWindowClass = True
Else
Msgbox "Could not obtain Window Handle (HWND) for IE.", vbInformation, "Failed To Get Handle"
End If
Feedback response number WEBB8YWT48 created by ~Mario Retumily on 10/09/2012